{include file="pub_header.htm"}
<div class="out_table">
<table width="100%" cellpadding="6" cellspacing="6" border="0" align="center" class="frame_table">
  <tr>
    <td width="20%" align="center" valign="top" bgcolor="#EEEEEE">
      {include file="pub_submenu.htm"}
    </td>
    <td width="80%" align="center" valign="top" bgcolor="#FFFFFF">

      {if $get.ope == "add"}
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=member" target="_self" class="current_place">会员管理</a>
            &raquo; <a href="{$control_admin}?act=member&ope=add&pag={$get.pag}" target="_self" class="current_place">添加会员</a>
          </td>
          <td align="right" nowrap>
            [
            <a href="{$control_admin}?act=member" target="_self" class="current_place">会员列表</a>
            ]
          </td>
        </tr>
      </table>
      </div>

      <div class="space"></div>
      <div class="right_table">
      <form id="member_add" name="member_add" method="post" action="javascript:void(null);" enctype="multipart/form-data">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="3">添加会员</td>
        </tr>
        <tr align="left">
          <td width="20%" class="block_left">会员名称</td>
          <td width="40%" class="block_right"><input type="text" id="username" name="username" maxlength="255" size="50" value="{$member_info.username}" class="input"></td>
          <td width="40%" class="block_right"><span id="username_return"><span class="prompt_primal">会员名称尽量不要修改</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">E-mail</td>
          <td class="block_right"><input type="text" id="email" name="email" maxlength="255" size="50" value="{$member_info.email}" class="input"></td>
          <td class="block_right"><span id="email_return"><span class="prompt_primal">&nbsp;</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员密码</td>
          <td class="block_right"><input type="text" id="password" name="password" maxlength="255" size="50" value="" class="input"></td>
          <td class="block_right"><span id="password_return"><span class="prompt_primal">不修改请留空</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">安全提示问题</td>
          <td class="block_right">
            <select id="question" name="question" class="select">
              <option value="">= 请选择 =</option>
              {foreach name=question from=$select_option.question item=item}
              <option value="{$item.id}">{$item.name}</option>
              {/foreach}
              <option value="custom">= 自定义密码提示问题 =</option>
            </select>
            <span id="question_custom_show" name="question_custom_show"></span>
          </td>
          <td class="block_right"><span id="question_return" name="question_return"><span class="prompt_primal">安全提示问题</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">安全提示答案</td>
          <td class="block_right"><input type="text" id="answer" name="answer" maxlength="255" size="50" value="" class="input"></td>
          <td class="block_right"><span id="answer_return"><span class="prompt_primal">安全提示答案</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员群组</td>
          <td class="block_right">
            <select name="mg_type" class="select" size="1">
            {foreach name=member_group_list from=$member_group_list item=member_group_list}
              {if $member_group_list.mg_type == $config.default_group_member}
              <option value="{$member_group_list.mg_type}" selected="selected">{$member_group_list.mg_type}</option>
              {else}
              <option value="{$member_group_list.mg_type}">{$member_group_list.mg_type}</option>
              {/if}
            {/foreach}
            </select>
            </td>
          <td class="block_right"><span id="mg_type_return"><span class="prompt_primal">通过类型和积分系统会自动判定所在群组</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">&nbsp;</td>
          <td class="block_right">
            时间限制:<input type="text" id="mg_type_expired" name="mg_type_expired" size="12" maxlength="10" value="0" class="input" />
            </td>
          <td class="block_right"><span id="mg_type_expired_return"><span class="prompt_primal">超过时间会员将回到系统默认用户组,0为永远不超过</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">积分</td>
          <td class="block_right"><input type="text" id="point" name="point" maxlength="11" size="12" value="0" class="input"> 分 </td>
          <td class="block_right"><span id="point_return"><span class="prompt_primal">通过类型和积分系统会自动判定所在群组</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">激活状态</td>
          <td class="block_right">
            <input type="radio" name="if_active" value="1" checked class="radio_y">&nbsp;开启
            <input type="radio" name="if_active" value="2" class="radio_n">&nbsp;关闭
            </td>
          <td class="block_right"><span id="if_active_return"><span class="prompt_primal">是否激活此会员</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员状态</td>
          <td class="block_right">
            <input type="radio" name="if_enable" value="1" checked class="radio_y">&nbsp;开启
            <input type="radio" name="if_enable" value="2" class="radio_n">&nbsp;关闭
            </td>
          <td class="block_right"><span id="if_enable_return"><span class="prompt_primal">是否开启此会员</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">订阅邮件</td>
          <td class="block_right">
            <input type="radio" name="if_email" value="1" checked class="radio_y">&nbsp;订阅
            <input type="radio" name="if_email" value="2" class="radio_n">&nbsp;退订
            </td>
          <td class="block_right"><span id="if_email_return"><span class="prompt_primal">是否开启此会员</span></span></td>
        </tr>
        <tr>
          <td colspan="3" align="center" class="block_footer">
          <input type="button" id="member_submit" name="member_submit" value="添加" class="button"
            onclick="xajax.$('member_submit').disabled=true;
                     xajax.$('member_submit').value='请等待...';
                     xajax_submit_form('add',xajax.getFormValues('member_add'),'member_submit');">
          </td>
        </tr>
      </table>
      </form>
      </div>
      {elseif $get.ope == "amend"}
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=member" target="_self" class="current_place">会员管理</a>
            &raquo; <a href="{$control_admin}?act=member&ope=amend&mid={$member_info.id}&pag={$get.pag}" target="_self" class="current_place">修改会员</a>
          </td>
          <td align="right" nowrap>
            [
            <a href="{$control_admin}?act=member&pag={$get.pag}" target="_self" class="current_place">会员列表</a>
            <a href="{$control_admin}?act=member&ope=add&pag={$get.pag}" target="_self" class="current_place">添加会员</a>
            ]
          </td>
        </tr>
      </table>
      </div>

      <div class="space"></div>
      <div class="right_table">
      <form id="member_amend" name="member_amend" method="post" action="javascript:void(null);" enctype="multipart/form-data">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="3">修改会员</td>
        </tr>
        <tr align="left">
          <td width="20%" class="block_left">ID</td>
          <td width="40%" class="block_right">{$member_info.id}</td>
          <td width="40%" class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员名称</td>
          <td class="block_right"><input type="text" id="username" name="username" maxlength="255" size="50" value="{$member_info.username}" class="input"></td>
          <td class="block_right"><span id="username_return"><span class="prompt_primal">会员名称尽量不要修改</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">E-mail</td>
          <td class="block_right"><input type="text" id="email" name="email" maxlength="255" size="50" value="{$member_info.email}" class="input"></td>
          <td class="block_right"><span id="email_return"><span class="prompt_primal">&nbsp;</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员密码</td>
          <td class="block_right"><input type="text" id="password" name="password" maxlength="255" size="50" value="" class="input"></td>
          <td class="block_right"><span id="password_return"><span class="prompt_primal">不修改请留空</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">安全提示问题</td>
          <td class="block_right">
            <select id="question" name="question" class="select">
              <option value="">= 请选择 =</option>
              {foreach name=question from=$select_option.question item=item}
              {if $member_info.question_type == "1" && $member_info.question == $item.id}
              <option value="{$item.id}" selected>{$item.name}</option>
              {else}
              <option value="{$item.id}">{$item.name}</option>
              {/if}
              {/foreach}
              {if $member_info.question_type == "1"}
              <option value="custom">= 自定义密码提示问题 =</option>
              {else}
              <option value="custom" selected>= 自定义密码提示问题 =</option>
              {/if}
            </select>
            <span id="question_custom_show" name="question_custom_show"></span>
          </td>
          <td class="block_right"><span id="question_return" name="question_return"><span class="prompt_primal">安全提示问题</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">安全提示答案</td>
          <td class="block_right"><input type="text" id="answer" name="answer" maxlength="255" size="50" value="{$member_info.answer}" class="input"></td>
          <td class="block_right"><span id="answer_return"><span class="prompt_primal">安全提示答案</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员群组</td>
          <td class="block_right">
            <select name="mg_type" class="select" size="1">
            {foreach name=member_group_list from=$member_group_list item=member_group_list}
              {if $member_group_list.mg_type == $member_info.mg_type}
              <option value="{$member_group_list.mg_type}" selected="selected">{$member_group_list.mg_type}</option>
              {else}
              <option value="{$member_group_list.mg_type}">{$member_group_list.mg_type}</option>
              {/if}
            {/foreach}
            </select>
            </td>
          <td class="block_right"><span id="mg_type_return"><span class="prompt_primal">通过类型和积分系统会自动判定所在群组</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">&nbsp;</td>
          <td class="block_right">
            时间限制:<input type="text" id="mg_type_expired" name="mg_type_expired" size="12" maxlength="10" value="{if $member_info.mg_type_expired!='0'}{$member_info.mg_type_expired|date_format:'%Y-%m-%d'}{else}0{/if}" class="input" />
            </td>
          <td class="block_right"><span id="mg_type_expired_return"><span class="prompt_primal">超过时间会员将回到系统默认用户组,0为永远不超过</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">积分</td>
          <td class="block_right"><input type="text" id="point" name="point" maxlength="11" size="12" value="{$member_info.point}" class="input"> 分 </td>
          <td class="block_right"><span id="point_return"><span class="prompt_primal">通过类型和积分系统会自动判定所在群组</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">激活状态</td>
          <td class="block_right">
            <input type="radio" name="if_active" value="1" {if $member_info.if_active == "1"}checked{/if} class="radio_y">&nbsp;开启
            <input type="radio" name="if_active" value="2" {if $member_info.if_active != "1"}checked{/if} class="radio_n">&nbsp;关闭
            </td>
          <td class="block_right"><span id="if_active_return"><span class="prompt_primal">是否激活此会员</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员状态</td>
          <td class="block_right">
            <input type="radio" name="if_enable" value="1" {if $member_info.if_enable == "1"}checked{/if} class="radio_y">&nbsp;开启
            <input type="radio" name="if_enable" value="2" {if $member_info.if_enable != "1"}checked{/if} class="radio_n">&nbsp;关闭
            </td>
          <td class="block_right"><span id="if_enable_return"><span class="prompt_primal">是否开启此会员</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">订阅邮件</td>
          <td class="block_right">
            <input type="radio" name="if_email" value="1" {if $member_info.if_email == "1"}checked{/if} class="radio_y">&nbsp;订阅
            <input type="radio" name="if_email" value="2" {if $member_info.if_email != "1"}checked{/if} class="radio_n">&nbsp;退订
            </td>
          <td class="block_right"><span id="if_email_return"><span class="prompt_primal">是否开启此会员</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">IP地址[激活]</td>
          <td class="block_right">{$member_info.ip_active}</td>
          <td class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">IP地址[建立]</td>
          <td class="block_right">{$member_info.ip_created}</td>
          <td class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">IP地址[更改]</td>
          <td class="block_right">{$member_info.ip_change}</td>
          <td class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">IP地址[访问]</td>
          <td class="block_right">{$member_info.ip_lastvisit}</td>
          <td class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">时间[激活]</td>
          <td class="block_right">{$member_info.time_active|date_format:"%Y-%m-%d %H:%M:%S"}</td>
          <td class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">时间[建立]</td>
          <td class="block_right">{$member_info.time_created|date_format:"%Y-%m-%d %H:%M:%S"}</td>
          <td class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">时间[更改]</td>
          <td class="block_right">{$member_info.time_change|date_format:"%Y-%m-%d %H:%M:%S"}</td>
          <td class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">时间[访问]</td>
          <td class="block_right">{$member_info.time_lastvisit|date_format:"%Y-%m-%d %H:%M:%S"}</td>
          <td class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">时间[累计在线]</td>
          <td class="block_right">{$member_info.cumulant_online/3600|@floor}h</td>
          <td class="block_right"></td>
        </tr>
        <tr>
          <td colspan="3" align="center" class="block_footer">
          <input type="button" id="member_submit" name="member_submit" value="编辑" class="button"
            onclick="xajax.$('member_submit').disabled=true;
                     xajax.$('member_submit').value='请等待...';
                     xajax_submit_form('amend',xajax.getFormValues('member_amend'),'member_submit');">
          </td>
        </tr>
      </table>
      </form>
      </div>
      {else}
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=member" target="_self" class="current_place">会员管理</a>
          </td>
          <td align="right" nowrap>
            [
            <a href="{$control_admin}?act=member&ope=add&pag={$get.pag}" target="_self" class="current_place">添加会员</a>
            ]
          </td>
        </tr>
      </table>
      </div>

      <div class="space"></div>
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="11">会员列表</td>
        </tr>
        <tr class="block_title">
          <td width="5%" nowrap>ID</td>
          <td width="15%" align="left" nowrap>会员名称</td>
          <td width="10%" align="left" nowrap>E-mail</td>
          <td width="5%" nowrap>会员积分</td>
          <td width="10%" nowrap>会员群组</td>
          <td width="10%" nowrap>时间限制</td>
          <td width="10%" nowrap>激活时间</td>
          <td width="10%" nowrap>最后访问</td>
          <td width="10%" nowrap>在线累积</td>
          <td width="5%" nowrap>状态</td>
          <td width="10%" nowrap>操作</td>
        </tr>
        {foreach name=member_list from=$member_list key=key item=member_list}
        <tr align="center" class="block_list" onmouseover="this.className='block_list_over'" onmouseout="this.className='block_list'">
          <td nowrap>{$member_list.id}</td>
          <td align="left"><span title="{$member_list.remark|str_entag:'space,br'}">{$member_list.username}</span></td>
          <td align="left"><a href="mailto:{$member_list.email}" target="_self" title="mailto:{$member_list.email}">{$member_list.email}</a></td>
          <td nowrap>{$member_list.point}</td>
          <td><a href="{$control_admin}?act=member_group&ope=amend&mg_id={$member_list.mg_id}" target="_self">{$member_list.mg_name}</td>
          <td nowrap>{if $member_list.mg_type_expired!='0'}{$member_list.mg_type_expired|date_format:'%Y-%m-%d'}{else}不限制{/if}</td>
          <td nowrap>{$member_list.time_active|date_format:'%Y-%m-%d<br />%H:%M:%S'}</td>
          <td nowrap>{$member_list.time_lastvisit|date_format:'%Y-%m-%d<br />%H:%M:%S'}</td>
          <td nowrap>{$member_list.cumulant_online/3600|@floor}h</td>
          <td nowrap>
            {if $member_list.if_enable == "1"}
              <span style="color:#00AA00;" title="当前状态为开启!">开</span>
              <a href="{$control_admin}?act=member&ope=if_enable&mid={$member_list.id}&if_enable=2&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为关闭!">关</span></a>
            {else}
              <a href="{$control_admin}?act=member&ope=if_enable&mid={$member_list.id}&if_enable=1&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为开启!">开</span></a>
              <span style="color:#EA7408;" title="当前状态为关闭!">关</span>
            {/if}
          </td>
          <td nowrap>
            <a href="{$control_admin}?act=member&ope=amend&mid={$member_list.id}&pag={$get.pag}" target="_self"><img src="{$dir_images_admin}/icon_edit.gif" border="0" alt="改" title="修改" /></a>
            <a href="{$control_admin}?act=member&ope=del&mid={$member_list.id}&pag={$get.pag}" target="_self" onClick="return confirm('真的要删除记录?')"><img src="{$dir_images_admin}/icon_delete.gif" border="0" alt="删" title="删除记录"></a>
          </td>
        </tr>
        {/foreach}
      </table>
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center">
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right">
            <span class="pagination_post_list">
              <span class="pagelink_side" title="Total record{$pagination.record_total}">{$pagination.record_total}</span>
              <span class="pagelink_side" title="Current page{$pagination.page_current}/Page{$pagination.page_total}"><font color="#EA7408">{$pagination.page_current}</font>/{$pagination.page_total}</span>
              {if $pagination.page_listbegin != ""}<span class="pagelink_side" title="Go to first page"><a href="{$pagination.url|print_format:$pagination.page_listbegin}" target="_self" class="pagehref">&laquo;</a></span>{/if}
              {if $pagination.page_listbegin_more != ""}<span class="pagelink_side" title="Jump {$pagination.page_listnum/2|@floor} page"><a href="{$pagination.url|print_format:$pagination.page_listbegin_more}" target="_self" class="pagehref">...</a></span>{/if}
              {if $pagination.page_previous != ""}<span class="pagelink_side" title="Previous page"><a href="{$pagination.url|print_format:$pagination.page_previous}" target="_self" class="pagehref">&#8249;</a></span>{/if}
              {foreach name=page_list from=$pagination.page_list item=page_list}
                {if $page_list.if_current == "1"}
                  <span class="pagelink_current" title="Current page{$page_list.page}"><font color="#EA7408">{$page_list.page}</font></span>
                {else}
                  <span class="pagelink" title="{$page_list.page}"><a href="{$pagination.url|print_format:$page_list.page}" target="_self" class="pagehref">{$page_list.page}</a></span>
                {/if}
              {/foreach}
              {if $pagination.page_next != ""}<span class="pagelink_side" title="Next page"><a href="{$pagination.url|print_format:$pagination.page_next}" target="_self" class="pagehref">&#8250;</a></span>{/if}
              {if $pagination.page_listend_more != ""}<span class="pagelink_side" title="Jump {$pagination.page_listnum/2|@floor} page"><a href="{$pagination.url|print_format:$pagination.page_listend_more}" target="_self" class="pagehref">...</a></span>{/if}
              {if $pagination.page_listend != ""}<span class="pagelink_side" title="Go to last page"><a href="{$pagination.url|print_format:$pagination.page_listend}" target="_self" class="pagehref">&raquo;</a></span>{/if}
              <select onchange="self.location.href=this.options[this.selectedIndex].value" class="select">
              {if $pagination.page_selectbegin != ""}<option value="{$pagination.url|print_format:$pagination.page_selectbegin}">{$pagination.page_selectbegin}</option>{/if}
              {if $pagination.page_selectbegin_more != ""}<option value="{$pagination.url|print_format:$pagination.page_selectbegin_more}">...</option>{/if}
              {foreach name=page_select from=$pagination.page_select item=page_select}
                {if $page_select.if_current == "1"}
                  <option value="{$pagination.url|print_format:$page_select.page}" selected="selected">{$page_select.page}</option>
                {else}
                  <option value="{$pagination.url|print_format:$page_select.page}">{$page_select.page}</option>
                {/if}
              {/foreach}
              {if $pagination.page_selectend_more != ""}<option value="{$pagination.url|print_format:$pagination.page_selectend_more}">...</option>{/if}
              {if $pagination.page_selectend != ""}<option value="{$pagination.url|print_format:$pagination.page_selectend}">{$pagination.page_selectend}</option>{/if}
              </select>
            </span>
          </td>
        </tr>
      </table>
      </div>
      {/if}

    </td>
  </tr>
</table>
{include file="pub_footer.htm"}